package com.sample.api;

import java.util.concurrent.CompletableFuture;

import com.swak.annotation.ApiDoc;
import com.swak.annotation.Get;
import com.swak.annotation.RestService;
import com.swak.entity.Result;

/**
 * 样例 API
 * 
 * @author DELL
 */
@RestService(path = "/api/sample", value = "SmapleApi")
public class SmapleApi {

	/**
	 * Hello.
	 * 
	 * @return
	 */
	@ApiDoc(module = "样例", function = "样例SayHello", describe = "Hello！")
	@Get("/say/hello")
	public Result<String> sayHello() {
		return Result.success("Hello！");
	}
	
	/**
	 * Hello.
	 * 
	 * @return
	 */
	@ApiDoc(module = "样例", function = "样例sayAsyncHello", describe = "Async Hello！")
	@Get("/say/async/hello")
	public CompletableFuture<Result<String>> sayAsyncHello() {
		return CompletableFuture.completedFuture(Result.success("Hello！"));
	}
}